import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class SortMapper extends Mapper<LongWritable, Text, IntWritable, IntWritable>{

    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String line = value.toString();
        String[] qp = line.split(" "); //空格切片
       // keyUtil keySort = new keyUtil(new Integer(qp[1]));
        //context.write(keySort,new IntWritable(Integer.parseInt(qp[0])));
        context.write(new IntWritable(Integer.parseInt(qp[1])),new IntWritable(Integer.parseInt(qp[0])));

    }
}
